package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.SysCmsMaterialMapper;
import com.ruoyi.cms.domain.SysCmsMaterial;
import com.ruoyi.cms.service.ISysCmsMaterialService;

/**
 * 媒体素材Service业务层处理
 * 
 * @author he
 * @date 2025-06-24
 */
@Service
public class SysCmsMaterialServiceImpl implements ISysCmsMaterialService 
{
    @Autowired
    private SysCmsMaterialMapper sysCmsMaterialMapper;

    /**
     * 查询媒体素材
     * 
     * @param id 媒体素材主键
     * @return 媒体素材
     */
    @Override
    public SysCmsMaterial selectSysCmsMaterialById(Long id)
    {
        return sysCmsMaterialMapper.selectSysCmsMaterialById(id);
    }

    @Override
    public SysCmsMaterial selectSysCmsMaterialByMaterialMark(SysCmsMaterial sysCmsMaterial) {
        return sysCmsMaterialMapper.selectSysCmsMaterialByMaterialMark(sysCmsMaterial);
    }

    /**
     * 查询媒体素材列表
     * 
     * @param sysCmsMaterial 媒体素材
     * @return 媒体素材
     */
    @Override
    public List<SysCmsMaterial> selectSysCmsMaterialList(SysCmsMaterial sysCmsMaterial)
    {
        return sysCmsMaterialMapper.selectSysCmsMaterialList(sysCmsMaterial);
    }

    /**
     * 新增媒体素材
     * 
     * @param sysCmsMaterial 媒体素材
     * @return 结果
     */
    @Override
    public int insertSysCmsMaterial(SysCmsMaterial sysCmsMaterial)
    {
        sysCmsMaterial.setCreateTime(DateUtils.getNowDate());
        return sysCmsMaterialMapper.insertSysCmsMaterial(sysCmsMaterial);
    }

    /**
     * 修改媒体素材
     * 
     * @param sysCmsMaterial 媒体素材
     * @return 结果
     */
    @Override
    public int updateSysCmsMaterial(SysCmsMaterial sysCmsMaterial)
    {
        return sysCmsMaterialMapper.updateSysCmsMaterial(sysCmsMaterial);
    }

    /**
     * 批量删除媒体素材
     * 
     * @param ids 需要删除的媒体素材主键
     * @return 结果
     */
    @Override
    public int deleteSysCmsMaterialByIds(Long[] ids)
    {
        return sysCmsMaterialMapper.deleteSysCmsMaterialByIds(ids);
    }

    /**
     * 删除媒体素材信息
     * 
     * @param id 媒体素材主键
     * @return 结果
     */
    @Override
    public int deleteSysCmsMaterialById(Long id)
    {
        return sysCmsMaterialMapper.deleteSysCmsMaterialById(id);
    }
}
